/*
 * sg8k.hpp
 *
 *  Created on: Nov 9, 2011
 *      Author: dgdiniz
 */

#ifndef SG8K_HPP_
#define SG8K_HPP_


struct Opcode68kInfo
{
	const char * opcodeName;
	const char * opcodeTemplate;
	uint16       opcodeNumber;
	uint16       opcodeFull;
	uint16       opcodeMask;
};


static OpcodeTable[] =
{
		{ "add",   "1101aaabccdddeee", 0xD, 0xD000, 0xF000 },
		{ "adda",  "1101aaab11dddeee", 0xD, 0xD0C0, 0xF0C0 },
};



//This is the representation of a 68k intruction.
//With this union we can get the individual fields of any type of 68k intructions.
//So the opcode functions can get their own fields directly.
union Intruction68k
{
	uint16 i;

	/*Template of instructions:
	 * add, adda*/
	struct{
		uint16 OPCODE    : 4; //Opcode
		uint16 DST       : 3; //Destination Register
		uint16 OPMODE    : 1; //Dest. Reg. is destination or source
		uint16 SIZE      : 2; //Inst. size: Byte, Word, Long. Used as opcode part in some inst (adda, etc)
		uint16 ADDRMODE  : 3; //Addressing Mode
		uint16 ADDRREG   : 3; //Addressing Register Number
	};



};


#endif /* SG8K_HPP_ */
